import React from 'react'
import StoForm from '../components/StoForm/StoForm'

const uploadImg = () => console.log("uploadImg");
const clearImg = () => console.log("clearImg");
const getUserRole = () => console.log("getUserRole");

const formFrame = [
    [
        {
            label: "账号",
            required: true,
            type: "text",
            key: "username",
        },
    ],
    [
        {
            label: "性别",
            required: true,
            type: "select",
            values: ["男", "女"],
            key: "gender"
        },
    ],

]

const data = {
    username: "TheOutlawChang",
    password: "123456",
    avatar: "/vite.svg",
    gender: "女",
    creator: "张二",
    desc: `
    Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsa porro perferendis error, odio voluptate deleniti, obcaecati quidem et minima ea, ullam delectus optio corporis fugiat officia quam accusamus ratione repudiandae.
    Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsa porro perferendis error, odio voluptate deleniti, obcaecati quidem et minima ea, ullam delectus optio corporis fugiat officia quam accusamus ratione repudiandae.
    Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsa porro perferendis error, odio voluptate deleniti, obcaecati quidem et minima ea, ullam delectus optio corporis fugiat officia quam accusamus ratione repudiandae.
    `
}

export default function FormDemo() {
    return (
        <div>
            <h3>FormDemo2</h3>
            <br />
            <StoForm
                formTitle={'一个简单的详情页'}
                formFrame={formFrame}
                formData={data}
                width={400}
                inset={false}
                editable={true}
                onConfirm={(newData: any) => {
                    console.log("onConfirm", newData);
                }}
            ></StoForm>
        </div>
    )
}
